FROM openjdk:8u342-jdk-buster

WORKDIR /opt/camellia-redis-proxy

ARG CamelliaVersion

ENV CamelliaVersion=$CamelliaVersion

RUN wget https://github.com/netease-im/camellia/releases/download/${CamelliaVersion}/camellia-redis-proxy-${CamelliaVersion}.tar.gz -O /tmp/camellia-redis-proxy.tar.gz

RUN mkdir -p /opt/camellia-redis-proxy \
    && tar -xzvf /tmp/camellia-redis-proxy.tar.gz -C /opt/camellia-redis-proxy --strip-components=1 \
    && rm /tmp/camellia-redis-proxy.tar.gz

RUN apt update  -y  && apt install net-tools vim  bc jq  redis-tools curl procps -y 

ADD https://github.com/krallin/tini/releases/download/v0.19.0/tini-amd64 /usr/local/bin/tini

RUN chmod +x /usr/local/bin/tini

ENTRYPOINT ["/usr/local/bin/tini", "--"]

CMD ["java", "-XX:+UseG1GC","-XX:+UseContainerSupport", "-Xms128m","-Xmx4096m","-server","org.springframework.boot.loader.JarLauncher"]
